import pulp
prob = pulp.LpProblem("Maximize_Profit", pulp.LpMaximize)

productA = pulp.LpVariable("ProductA", lowBound=0, cat='Integer')
productB = pulp.LpVariable("ProductB", lowBound=0, cat='Integer')

prob += (20 - 10) * productA + (30 - 15) * productB  # 利润 = 销售价格 - 生产成本

prob += 2 * productA + 3 * productB <= 100  # 生产产品A和产品B的总工时不超过100小时

prob.solve()

print("产品A 生产数量: ", pulp.value(productA))
print("产品B 生产数量: ", pulp.value(productB))
print("最大利润: ", pulp.value(prob.objective))
